<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="WEB-INF/translate.tld" prefix="ego" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Login</title>
<script type="text/javascript">
function login_popup_manual()
{
	window.open("<%= request.getAttribute("redirect_url") %>", "google_login", "width=640,height=480,resizable=yes,scrollbars=yes");
	return false;
}
function load()
{
    <% if (request.getAttribute("close") != null) { %>
    	window.setTimeout(function()
    		{
		    	window.parent.opener.location.reload();
		    	window.close();
    		}, 250);
	<% } else { %>
		var x = window.open("<%= request.getAttribute("redirect_url") %>", "google_login", "width=640,height=480,resizable=yes,scrollbars=yes");
		if (x == null)
		{
			document.getElementById('msg').innerHTML = '<ego:t>You have to disable the popup-blocker or</ego:t> <a onclick="login_popup_manual()"><ego:t>click here</ego:t></a> <ego:t>to open the popup manually</ego:t>.';
			document.getElementById('img').src = 'pub/img/warning.gif';
		} else
		{
			document.getElementById('msg').innerHTML = '<ego:t>Please accept google access</ego:t>';
			document.getElementById('msg').style['visibility'] = 'hidden';
		}
	<% } %>
}
</script>
<style type="text/css">
	body { font-size:12px }
	a {
		cursor: pointer;
		color: blue;
		text-decoration: underline;
	}
</style>
</head>
<body onload="load()">
<center>
	<img src="pub/img/login-loading.gif" id="img" />
	<div id="msg"><ego:t>Logging in</ego:t>...</div>
</center>
</body>
</html>
